#!/usr/bin/env python
# coding=utf-8
 
# from PyCameraList.camera_device import list_video_devices
 
# cameras = list_video_devices()
# print(dict(cameras))
# for d in dict(cameras):
#     print(d)
#     v = cameras[d]
#     print(v)
    
#     if 'XW500' in v:
#         print('外部摄像头id=',d)
    
#return: {0: 'Intel(R) RealSense(TM) 3D Camera (Front F200) RGB', 1: 'NewTek NDI Video', 2: 'Intel(R) RealSense(TM) 3D Camera Virtual Driver', 3: 'Intel(R) RealSense(TM) 3D Camera (Front F200) Depth', 4: 'OBS-Camera', 5: 'OBS-Camera2', 6: 'OBS-Camera3', 7: 'OBS-Camera4', 8: 'OBS Virtual Camera'}
 
# audios = list_audio_devices()
# print(dict(audios))
#return:  {0: '麦克风阵列 (Creative VF0800)', 1: 'OBS-Audio', 2: '线路 (NewTek NDI Audio)'}
 
import tkinter as tk
from PIL import Image,ImageTk
from tkinter import ttk

win = tk.Tk()
win.geometry("600x600")

def aa():



    global img0
    photo = Image.open("./image/image0.jpg")  #括号里为需要显示在图形化界面里的图片
   
    photo = photo.resize((400,400))  #规定图片大小
    img0 = ImageTk.PhotoImage(photo)
    img1 = ttk.Label(text="照片:",image=img0)
    
    img1.pack()





anniu = tk.Button(win,text="点击",command=aa).pack()

win.mainloop()



